package com.ibeeking.found.open.api.feign;


import com.ibeeking.found.open.api.common.param.cop.CopDepartmentParam;
import com.ibeeking.found.open.api.common.param.cop.CopEmployeeParam;
import com.ibeeking.found.open.api.feign.fallback.CopFeignFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author ibeeking
 */
@FeignClient(name = "base-cop-b-server", path = "/b", contextId = "CopOpenFeignClient", fallbackFactory = CopFeignFallbackFactory.class, decode404 = true)
public interface CopFeignClient {

    /**
     * 从企业微信批量导入部门列表
     *
     * @param params
     * @return
     */
    @PostMapping("/contact/feign/v1/batchInsertDepartmentListFromWxCp")
    ResponseResult<Integer> batchInsertDepartmentListFromWxCp(@RequestBody List<CopDepartmentParam> params);

    /**
     * 从企业微信导入部门信息
     *
     * @param param
     * @return
     */
    @PostMapping("/contact/feign/v1/insertDepartmentFromWxCp")
    ResponseResult<Integer> insertDepartmentFromWxCp(@RequestBody CopDepartmentParam param);

    /**
     * 从企业微信导入部门信息
     *
     * @param param
     * @return
     */
    @PostMapping("/contact/feign/v1/updateDepartmentFromWxCp")
    ResponseResult<Integer> updateDepartmentFromWxCp(@RequestBody CopDepartmentParam param);
    /**
     * 从企业微信删除部门信息
     * @param tenantId
     * @param id
     * @return
     */
    @PostMapping("/contact/feign/v1/deleteDepartmentFromWxCp/{tenantId}/{id}")
    ResponseResult<Integer> deleteDepartmentFromWxCp(@PathVariable("tenantId") Long tenantId, @PathVariable("id") Long id);

    /**
     * 从企业微信批量导入员工列表
     *
     * @param params
     * @return
     */
    @PostMapping("/contact/feign/v1/batchInsertEmployeeListFromWxCp")
    ResponseResult<Integer> batchInsertEmployeeListFromWxCp(@RequestBody List<CopEmployeeParam> params);

    /**
     * 从企业微信导入员工信息
     *
     * @param param
     * @return
     */
    @PostMapping("/contact/feign/v1/insertEmployeeFromWxCp")
    ResponseResult<Integer> insertEmployeeFromWxCp(@RequestBody CopEmployeeParam param);

    /**
     * 从企业微信导入员工信息
     *
     * @param param
     * @return
     */
    @PostMapping("/contact/feign/v1/updateEmployeeFromWxCp")
    ResponseResult<Integer> updateEmployeeFromWxCp(@RequestBody CopEmployeeParam param);
    /**
     * 从企业微信删除员工信息
     * @param tenantId
     * @param id
     * @return
     */
    @PostMapping("/contact/feign/v1/deleteEmployeeFromWxCp/{tenantId}/{id}")
    ResponseResult<Integer> deleteEmployeeFromWxCp(@PathVariable("tenantId") Long tenantId, @PathVariable("id") Long id);

}
